package com.deepblue.image.maker.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.nio.charset.StandardCharsets;

/**
 * TODO
 *
 * @author yymagicer
 * @version 1.0
 * @date 2021/11/9 上午9:51
 */
@Configuration
public class FreemakerConfig {


    public static final String UTF_8="utf-8";

    @Bean
    public freemarker.template.Configuration configuration(){
        freemarker.template.Configuration configuration = new freemarker.template.Configuration();
        configuration.setDefaultEncoding(StandardCharsets.UTF_8.name());
        configuration.setClassForTemplateLoading(this.getClass(), "/templates");
        return configuration;
    }
}
